import mathfrom math import pi pi_2 = 2.0 * pi def Angle(value):	ret = abs(value) % pi_2	if value < 0: return -ret	return retdef DirectionAngle( goal, current ):	diff = Angle( goal - current )	if diff > math.pi:		diff -= pi_2	elif diff < - math.pi:		diff += pi_2	return diff	print DirectionAngle(-0.5 * pi, 2.0 * pi)#print Angle(7.0)